GUI Help > Create > createLabel

createLabel
int handle=createLabel(int x, int y, int width, int height, str caption, handle parent)

Description:
Creates a new label gadget. Labels are simple pieces of text used to label parts of your program, or provide status information to the user.

Return Value:
Handle to the new label.

Parameters:
x X position of new gadget
y Y position of new gadget
width Width of new gadget in pixels
height Height of new gadget in pixels
caption Text which appears on the face of the label
parent Handle to the parent of the new gadget, or 0 for the main window
Remarks:


See Also:


Example:
(Note: You will need to include the GUI constants file for this example to work)

if (not GUI_CONSTANTS) then errorMessage "You need to include the constants file for this example to work"

`Create a background panel
back=createPanel(0,0,640,480,0)

`Create label gadgets inside panel
coords=createLabel(10,10,400,15,"Move the mouse over the window to see its position:",back)
xLabel=createLabel(10,30,50,15,"X:",back)
yLabel=createLabel(10,50,50,15,"Y:",back)

do
	setGadgetText xLabel,"X: " + str$(mousePosX())
	setGadgetText yLabel,"Y: " + str$(mousePosY())
loop